﻿Ext.define("entgpv11.store.Notes", {
    extend: "Ext.data.Store",
    requires: [
        'Ext.data.proxy.LocalStorage'
    ],
    config: {
        model: "entgpv11.model.Note",
        proxy: {
				type:"ajax",
				url: Ext.APP_GLOBAL.getServiceUrl() + "GetProyectoByFilter",
				scriptTag: true,
                actionMethods:
				{
					read: 'POST'
				},
				extraParams:{
							iProgramaId:"0",	
							iEjeId:"0",	
							iTipoId:"0",	
							iEstadoId:"0",	
							sText:"",	
							IdEmp:"2"
				},
                reader: {
				  type: 'json',
				  rootProperty:'user'
			    }
		},
		autoLoad: false,
		sorters: [{ property: 'FechaInicio', direction: 'DESC'}],
        grouper: {
            sortProperty: "FechaInicio",
            direction: "DESC",
            groupFn: function (record) {
                if (record && record.data.FechaInicio) {
                    return record.data.FechaInicio.toDateString();
                } else {
                    return '';
                }
            }
        }
    }
});
